define({
  color: [
    '#02a8f5',
    '#90ed7e',
    '#e3dc1b',
    '#f79628',
    '#ab5ee6',
    '#f26f92',
    '#1970fc',
    '#637bff',
    '#13d1c1',
    '#22d47e'
  ],
  grid: {
    bottom: 70,
    containLabel: true,
    left: 30,
    right: 30,
    top: 36
  },
  legend: {
    data: [
      '流入量',
      '流出量'
    ],
    show: true,
    textStyle: {
      color: '#fff',
      fontSize: 12
    },
    top: 'top',
    right: '5%',
    orient: 'horizontal'
  },
  padding: {
    bottom: 30,
    left: 0,
    right: 0,
    top: 0
  },
  series: [
    {
      data: [
        [
          '2018/1/23 10:54:00',
          0.16,
          '流入量'
        ],
        [
          '2018/1/23 10:54:10',
          0.15,
          '流入量'
        ],
        [
          '2018/1/23 10:54:20',
          0.14,
          '流入量'
        ],
        [
          '2018/1/23 10:54:30',
          0.13,
          '流入量'
        ],
        [
          '2018/1/23 10:54:40',
          0.13,
          '流入量'
        ],
        [
          '2018/1/23 10:54:50',
          0.14,
          '流入量'
        ],
        [
          '2018/1/23 10:55:00',
          0.15,
          '流入量'
        ],
        [
          '2018/1/23 10:55:10',
          0.14,
          '流入量'
        ],
        [
          '2018/1/23 10:55:20',
          0.14,
          '流入量'
        ],
        [
          '2018/1/23 10:55:30',
          0.15,
          '流入量'
        ],
        [
          '2018/1/23 10:55:40',
          0.15,
          '流入量'
        ],
        [
          '2018/1/23 10:55:50',
          0.16,
          '流入量'
        ],
        [
          '2018/1/23 10:56:00',
          0.15,
          '流入量'
        ],
        [
          '2018/1/23 10:56:10',
          0.15,
          '流入量'
        ],
        [
          '2018/1/23 10:56:20',
          0.15,
          '流入量'
        ],
        [
          '2018/1/23 10:56:30',
          0.15,
          '流入量'
        ],
        [
          '2018/1/23 10:56:40',
          0.16,
          '流入量'
        ],
        [
          '2018/1/23 10:56:50',
          0.16,
          '流入量'
        ],
        [
          '2018/1/23 10:57:00',
          0.16,
          '流入量'
        ],
        [
          '2018/1/23 10:57:10',
          0.16,
          '流入量'
        ],
        [
          '2018/1/23 10:57:20',
          0.17,
          '流入量'
        ],
        [
          '2018/1/23 10:57:30',
          0.17,
          '流入量'
        ],
        [
          '2018/1/23 10:57:40',
          0.18,
          '流入量'
        ],
        [
          '2018/1/23 10:57:50',
          0.17,
          '流入量'
        ],
        [
          '2018/1/23 10:58:00',
          0.17,
          '流入量'
        ],
        [
          '2018/1/23 10:58:10',
          0.17,
          '流入量'
        ],
        [
          '2018/1/23 10:58:20',
          0.16,
          '流入量'
        ],
        [
          '2018/1/23 10:58:30',
          0.15,
          '流入量'
        ],
        [
          '2018/1/23 10:58:40',
          0.15,
          '流入量'
        ],
        [
          '2018/1/23 10:58:50',
          0.15,
          '流入量'
        ],
        [
          '2018/1/23 10:59:00',
          0.16,
          '流入量'
        ],
        [
          '2018/1/23 10:54:00',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:54:10',
          0.08,
          '流出量'
        ],
        [
          '2018/1/23 10:54:20',
          0.08,
          '流出量'
        ],
        [
          '2018/1/23 10:54:30',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:54:40',
          0.1,
          '流出量'
        ],
        [
          '2018/1/23 10:54:50',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:55:00',
          0.08,
          '流出量'
        ],
        [
          '2018/1/23 10:55:10',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:55:20',
          0.1,
          '流出量'
        ],
        [
          '2018/1/23 10:55:30',
          0.08,
          '流出量'
        ],
        [
          '2018/1/23 10:55:40',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:55:50',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:56:00',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:56:10',
          0.1,
          '流出量'
        ],
        [
          '2018/1/23 10:56:20',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:56:30',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:56:40',
          0.08,
          '流出量'
        ],
        [
          '2018/1/23 10:56:50',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:57:00',
          0.07,
          '流出量'
        ],
        [
          '2018/1/23 10:57:10',
          0.08,
          '流出量'
        ],
        [
          '2018/1/23 10:57:20',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:57:30',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:57:40',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:57:50',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:58:00',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:58:10',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:58:20',
          0.08,
          '流出量'
        ],
        [
          '2018/1/23 10:58:30',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:58:40',
          0.1,
          '流出量'
        ],
        [
          '2018/1/23 10:58:50',
          0.09,
          '流出量'
        ],
        [
          '2018/1/23 10:59:00',
          0.09,
          '流出量'
        ]
      ],
      itemStyle: {
        emphasis: {
          shadowBlur: 20,
          shadowColor: 'rgba(0, 0, 0, 0.8)'
        }
      },
      label: {
        normal: {
          show: false
        }
      },
      type: 'themeRiver'
    }
  ],
  singleAxis: {
    axisLabel: {
      color: '#70C3FA',
      fontSize: '20',
      margin: 8,
      rotate: 0,
      show: true,
      formatter: function(value) {
          let time = new Date(value)
          let hours = time.getHours().toString()
          let minutes = time.getMinutes().toString()
          let seconds = time.getSeconds().toString()

          hours = hours.length > 1 ? hours : `0${hours}`
          minutes = minutes.length > 1 ? minutes : `0${minutes}`
          seconds = seconds.length > 1 ? seconds : `0${seconds}`

          return `${hours}:${minutes}:${seconds}`
      }
    },
    axisLine: {
      lineStyle: {
        color: '#236592',
        opacity: 100,
        width: 1
      },
      onZero: true,
      show: true
    },
    axisTick: {
      show: false
    },
    bottom: 70,
    left: 30,
    nameTextStyle: {
      color: '#fff',
      fontSize: 12,
      opacity: 1
    },
    right: 30,
    seperate: 'auto',
    splitLine: {
      lineStyle: {
        color: '#236592',
        opacity: 1,
        type: 'solid'
      },
      show: true
    },
    top: 36,
    type: 'time',
    splitNumber: 6
  },
  textStyle: {
    color: '#fff'
  },
  toolbox: {
    show: true
  },
  tooltip: {
    show: true,
    axisPointer: {
      lineStyle: {
        color: 'rgba(0,0,0,0.2)',
        type: 'solid',
        width: 1
      },
      type: 'line'
    },
    alwaysShowContent: true,
    enterable: true,
    formatter: function(param) {
        
        let date = param[0] && param[0].axisValue
        let time = new Date(date)
        let hours = time.getHours().toString()
        let minutes = time.getMinutes().toString()
        let seconds = time.getSeconds().toString()
        hours = hours.length > 1 ? hours : `0${hours}`
        minutes = minutes.length > 1 ? minutes : `0${minutes}`
        seconds = seconds.length > 1 ? seconds : `0${seconds}`
        date = `${hours}:${minutes}:${seconds}`
        
        let tooltipText = `${date}`
        param.map(item => {
            if (item && item.name && item.data) {
                tooltipText += `<br />${item.name}: ${item.data[1]}`
            }
        })
        
        return tooltipText
    },
    trigger: 'axis'
  }
})